import java.util.Scanner;

public class Main {
    public static int getsum(int n){
        if(n == 0)
            return 0;
        int tmp = getsum(n/10);
        return tmp+(n%10)*(n%10)*(n%10);
    }
//每一位相加-->3位水仙花数
    public static void main4(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int ret = getsum(n);
        System.out.println(ret);
    }

    public static void getnum(int n){//方法是小驼峰-不建议大写
        if(n == 0)
            return;
        else{
            getnum(n/10);
            System.out.printf("%d ",n%10);
        }
    }
//按顺序打印一个数字的每一位
    public static void main3(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        getnum(n);// /10 %10 的方法--%10得到最后一位
    }

    public static int Fac(int n){//用小驼峰-不建议大写
        if(n == 0)
            return 1;
        else {
            return n*Fac(n-1);
        }
    }
//递归求阶乘
    public static void main2(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        System.out.printf("%d的阶乘是%d",n,Fac(n));
    }

    public static int Fib(int n) {
        if(n == 1 || n == 2){
            return 1;
        }
        else{
            return Fib(n-1)+Fib(n-2);
        }
    }
//斐波那契数列
    public static void main1(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        System.out.printf("第%d个斐波那契数=%d\n",n,Fib(n));
    }
}